package com.xiaolin.designmode.factory.abstraction;

import com.xiaolin.designmode.factory.bean.Computer;
import com.xiaolin.designmode.factory.bean.Phone;

/**
 * @ClassName AbstractFactoryTest
 * @Description TODO
 * @Detail detail
 * @Author MyPC
 * @Date 2020/10/29
 * @Version 1.0
 */
public class AbstractFactoryTest {
    public static void main(String[] args) {
        AbstractFactory xiaomi=new XiaomiAbstractFactory();
        AbstractFactory huawei=new HuaweiAbstractFactory();
        //生产小米手机
        Phone xiaomiP = xiaomi.productPhone();
        xiaomiP.name();
        //生产小米电脑
        Computer xiaomiC = xiaomi.productComputer();
        xiaomiC.name();
        //生产华为手机
        Phone huaweiP = huawei.productPhone();
        huaweiP.name();
        //生产华为电脑
        Computer huaweiC = huawei.productComputer();
        huaweiC.name();
    }
}
